#pragma once

#include <string>
#include <vector>

#include <tr1/unordered_map>
#include <tr1/unordered_set>

using namespace std;
using namespace std::tr1;

typedef size_t logical_variable_t;
typedef vector<logical_variable_t>                           logvar_list_t;
typedef unordered_set<logical_variable_t>                    logvar_set_t;
typedef unordered_map<logical_variable_t,logical_variable_t> vv_dict_t;
typedef unordered_map<logical_variable_t,logvar_set_t>       vvset_dict_t;
typedef unordered_map<string,logvar_set_t>                   svset_dict_t;
typedef unordered_map<logical_variable_t,string>             vs_dict_t;
typedef unordered_map<logical_variable_t,int>                vi_dict_t;
typedef unordered_map<string,logical_variable_t>             sv_dict_t;

/* Classes. */
class variable_manager_t {

  vs_dict_t m_p2v;
  
public:
    
  logical_variable_t register_variable( const string &var );
  string p2v( const logical_variable_t &p ) const;
  string join( const logvar_list_t& il, const string& delimiter = "," ) const;
  string join( const logvar_set_t& il, const string& delimiter  = "," ) const;
    
};
